/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Recetas.java
 *
 * Created on 27-feb-2012, 14:40:43
 */

package desktop;

import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author KrooS
 */
public class Recetas extends javax.swing.JDialog {
    ResultSetTableModel recetas;
    ResultSetTableModel prods;
    String Query1="select * from recetas_pendientes where rut_cliente=";
    String Query2="select * from recetas_vendidas where rut_cliente=";
    String Query3="select nombre,cant_prod from producto_pendiente where id_receta=";
    String Query4="select nombre,cantidad from prods_vendidos,productos where prods_vendidos.id_producto= productos.id_producto and id_boleta=";
    

    /** Creates new form Recetas */
    public Recetas(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        panel_recetas = new javax.swing.JPanel();
        grupo_pest = new javax.swing.JTabbedPane();
        pendientes = new javax.swing.JScrollPane();
        panel_pend = new javax.swing.JPanel();
        jLabel1_pend = new javax.swing.JLabel();
        jTextField1_pend = new javax.swing.JTextField();
        jScrollPane1_pend = new javax.swing.JScrollPane();
        jTable1_pend = new javax.swing.JTable();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        buscar_pendiente = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        digito_pend = new javax.swing.JTextField();
        vendidas = new javax.swing.JScrollPane();
        jPanel2_vend = new javax.swing.JPanel();
        jLabel2_vend = new javax.swing.JLabel();
        jTextField2_vend = new javax.swing.JTextField();
        jScrollPane2_vend = new javax.swing.JScrollPane();
        jTable2_Vend = new javax.swing.JTable();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTable2 = new javax.swing.JTable();
        Buscar_Receta = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        digito_vend = new javax.swing.JTextField();
        titulo_recetas = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        panel_recetas.setBackground(new java.awt.Color(156, 203, 216));

        jLabel1_pend.setText("Ingrese Rut Paciente");

        jTextField1_pend.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                jTextField1_pendKeyTyped(evt);
            }
        });

        jTable1_pend.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Id Boleta", "Fecha Ingres", "Rut Medico", "Rut Cliente"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.Object.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTable1_pend.getTableHeader().setResizingAllowed(false);
        jTable1_pend.getTableHeader().setReorderingAllowed(false);
        jTable1_pend.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTable1_pendMouseClicked(evt);
            }
        });
        jScrollPane1_pend.setViewportView(jTable1_pend);

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Producto", "Cantidad"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTable1.getTableHeader().setResizingAllowed(false);
        jTable1.getTableHeader().setReorderingAllowed(false);
        jScrollPane1.setViewportView(jTable1);

        buscar_pendiente.setText("Buscar");
        buscar_pendiente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buscar_pendienteActionPerformed(evt);
            }
        });

        jLabel1.setText("-");

        digito_pend.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                digito_pendKeyTyped(evt);
            }
        });

        javax.swing.GroupLayout panel_pendLayout = new javax.swing.GroupLayout(panel_pend);
        panel_pend.setLayout(panel_pendLayout);
        panel_pendLayout.setHorizontalGroup(
            panel_pendLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel_pendLayout.createSequentialGroup()
                .addGroup(panel_pendLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panel_pendLayout.createSequentialGroup()
                        .addGap(134, 134, 134)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 377, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panel_pendLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addGroup(panel_pendLayout.createSequentialGroup()
                            .addGap(43, 43, 43)
                            .addComponent(jLabel1_pend)
                            .addGap(18, 18, 18)
                            .addComponent(jTextField1_pend, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jLabel1)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(digito_pend, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(buscar_pendiente))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, panel_pendLayout.createSequentialGroup()
                            .addGap(93, 93, 93)
                            .addComponent(jScrollPane1_pend, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(193, Short.MAX_VALUE))
        );
        panel_pendLayout.setVerticalGroup(
            panel_pendLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel_pendLayout.createSequentialGroup()
                .addGap(28, 28, 28)
                .addGroup(panel_pendLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1_pend)
                    .addComponent(jTextField1_pend, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(buscar_pendiente)
                    .addComponent(jLabel1)
                    .addComponent(digito_pend, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(42, 42, 42)
                .addComponent(jScrollPane1_pend, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(65, 65, 65)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(132, Short.MAX_VALUE))
        );

        pendientes.setViewportView(panel_pend);

        grupo_pest.addTab("Recetas pendientes Paciente", pendientes);

        jLabel2_vend.setText("Ingrese Rut Paciente");

        jTextField2_vend.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                jTextField2_vendKeyTyped(evt);
            }
        });

        jTable2_Vend.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "id. Boleta", "Fecha de Venta", "Rut Paciente"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.Object.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTable2_Vend.getTableHeader().setResizingAllowed(false);
        jTable2_Vend.getTableHeader().setReorderingAllowed(false);
        jTable2_Vend.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTable2_VendMouseClicked(evt);
            }
        });
        jScrollPane2_vend.setViewportView(jTable2_Vend);

        jTable2.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Producto", "Cantidad"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTable2.getTableHeader().setResizingAllowed(false);
        jTable2.getTableHeader().setReorderingAllowed(false);
        jScrollPane2.setViewportView(jTable2);

        Buscar_Receta.setText("Buscar");
        Buscar_Receta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Buscar_RecetaActionPerformed(evt);
            }
        });

        jLabel2.setText("-");

        digito_vend.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                digito_vendKeyTyped(evt);
            }
        });

        javax.swing.GroupLayout jPanel2_vendLayout = new javax.swing.GroupLayout(jPanel2_vend);
        jPanel2_vend.setLayout(jPanel2_vendLayout);
        jPanel2_vendLayout.setHorizontalGroup(
            jPanel2_vendLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2_vendLayout.createSequentialGroup()
                .addGroup(jPanel2_vendLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2_vendLayout.createSequentialGroup()
                        .addGap(140, 140, 140)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 377, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2_vendLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2_vendLayout.createSequentialGroup()
                            .addGap(43, 43, 43)
                            .addComponent(jLabel2_vend)
                            .addGap(18, 18, 18)
                            .addComponent(jTextField2_vend, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jLabel2)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(digito_vend, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(Buscar_Receta))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2_vendLayout.createSequentialGroup()
                            .addGap(100, 100, 100)
                            .addComponent(jScrollPane2_vend, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(186, Short.MAX_VALUE))
        );
        jPanel2_vendLayout.setVerticalGroup(
            jPanel2_vendLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2_vendLayout.createSequentialGroup()
                .addGap(28, 28, 28)
                .addGroup(jPanel2_vendLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2_vend)
                    .addComponent(jTextField2_vend, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(Buscar_Receta)
                    .addComponent(jLabel2)
                    .addComponent(digito_vend, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(63, 63, 63)
                .addComponent(jScrollPane2_vend, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(30, 30, 30)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(146, Short.MAX_VALUE))
        );

        vendidas.setViewportView(jPanel2_vend);

        grupo_pest.addTab("Recetas Vendidas Paciente", vendidas);

        javax.swing.GroupLayout panel_recetasLayout = new javax.swing.GroupLayout(panel_recetas);
        panel_recetas.setLayout(panel_recetasLayout);
        panel_recetasLayout.setHorizontalGroup(
            panel_recetasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel_recetasLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(grupo_pest, javax.swing.GroupLayout.DEFAULT_SIZE, 682, Short.MAX_VALUE)
                .addContainerGap())
        );
        panel_recetasLayout.setVerticalGroup(
            panel_recetasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel_recetasLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(grupo_pest, javax.swing.GroupLayout.DEFAULT_SIZE, 438, Short.MAX_VALUE)
                .addContainerGap())
        );

        titulo_recetas.setFont(new java.awt.Font("Tahoma", 1, 18));
        titulo_recetas.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        titulo_recetas.setText("Recetas Medicas");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(270, 270, 270)
                .addComponent(titulo_recetas, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(282, Short.MAX_VALUE))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(panel_recetas, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(titulo_recetas, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(505, Short.MAX_VALUE))
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(78, 78, 78)
                    .addComponent(panel_recetas, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()))
        );

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-730)/2, (screenSize.height-576)/2, 730, 576);
    }// </editor-fold>//GEN-END:initComponents

    private void Buscar_RecetaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Buscar_RecetaActionPerformed
        // TODO add your handling code here:
         String rut=this.jTextField2_vend.getText();
        String dig=this.digito_vend.getText();
        String rut_Completo=rut+"-"+dig;
        //System.out.println(rut_Completo);

        if(!this.jTextField2_vend.getText().isEmpty() && !this.digito_vend.getText().isEmpty() )
        {
             try {

                String busqueda_vendida = Query2+"'"+rut_Completo+"'";
                recetas= new ResultSetTableModel(Conex.CONTROLADOR, Conex.URL_BASEDATOS, Conex.NOMBRE_USUARIO, Conex.CONTRA, busqueda_vendida);
                this.jTable2_Vend.setModel(recetas);
            } catch (SQLException ex) {
                Logger.getLogger(Productos.class.getName()).log(Level.SEVERE, null, ex);
            } catch (ClassNotFoundException ex) {
                Logger.getLogger(Productos.class.getName()).log(Level.SEVERE, null, ex);
            }
        }

    }//GEN-LAST:event_Buscar_RecetaActionPerformed

    private void jTextField1_pendKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField1_pendKeyTyped
        // TODO add your handling code here:
         char caracter = evt.getKeyChar();

      // Verificar si la tecla pulsada no es un digito
      if(((caracter < '0') ||
         (caracter > '9')) &&
         (caracter != '\b' /*corresponde a BACK_SPACE*/))
      {
         evt.consume();  // ignorar el evento de teclado
      }
    }//GEN-LAST:event_jTextField1_pendKeyTyped

    private void digito_pendKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_digito_pendKeyTyped
        // TODO add your handling code here:
       
    }//GEN-LAST:event_digito_pendKeyTyped

    private void jTextField2_vendKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextField2_vendKeyTyped
        // TODO add your handling code here:
         char caracter = evt.getKeyChar();

      // Verificar si la tecla pulsada no es un digito
      if(((caracter < '0') ||
         (caracter > '9')) &&
         (caracter != '\b' /*corresponde a BACK_SPACE*/))
      {
         evt.consume();  // ignorar el evento de teclado
      }
    }//GEN-LAST:event_jTextField2_vendKeyTyped

    private void digito_vendKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_digito_vendKeyTyped
        // TODO add your handling code here:
       
    }//GEN-LAST:event_digito_vendKeyTyped

    private void buscar_pendienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buscar_pendienteActionPerformed
        // TODO add your handling code here:
        String rut=this.jTextField1_pend.getText();
        String dig=this.digito_pend.getText();
        String rut_Completo=rut+"-"+dig;
        //System.out.println(rut_Completo);

        if(!this.jTextField1_pend.getText().isEmpty() && !this.digito_pend.getText().isEmpty() )
        {
             try {

                String busqueda_receta = Query1+"'"+rut_Completo+"'";
                recetas= new ResultSetTableModel(Conex.CONTROLADOR, Conex.URL_BASEDATOS, Conex.NOMBRE_USUARIO, Conex.CONTRA, busqueda_receta);
                this.jTable1_pend.setModel(recetas);
            } catch (SQLException ex) {
                Logger.getLogger(Productos.class.getName()).log(Level.SEVERE, null, ex);
            } catch (ClassNotFoundException ex) {
                Logger.getLogger(Productos.class.getName()).log(Level.SEVERE, null, ex);
            }
        }

    }//GEN-LAST:event_buscar_pendienteActionPerformed

    private void jTable2_VendMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable2_VendMouseClicked
        // TODO add your handling code here:
        int indice=this.jTable2_Vend.getSelectedRow();
        Object id_boleta =this.jTable2_Vend.getValueAt(indice, 0);
        System.out.println(id_boleta);

         try {

                String prod_vend = Query4+id_boleta;
                prods= new ResultSetTableModel(Conex.CONTROLADOR, Conex.URL_BASEDATOS, Conex.NOMBRE_USUARIO, Conex.CONTRA, prod_vend);
                this.jTable2.setModel(prods);
            } catch (SQLException ex) {
                Logger.getLogger(Productos.class.getName()).log(Level.SEVERE, null, ex);
            } catch (ClassNotFoundException ex) {
                Logger.getLogger(Productos.class.getName()).log(Level.SEVERE, null, ex);
            }

    }//GEN-LAST:event_jTable2_VendMouseClicked

    private void jTable1_pendMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable1_pendMouseClicked
        // TODO add your handling code here:
        int indice=this.jTable1_pend.getSelectedRow();
        Object id_boleta =this.jTable1_pend.getValueAt(indice, 0);
        System.out.println(id_boleta);

         try {

                String prod_pend = Query3+id_boleta;
                prods= new ResultSetTableModel(Conex.CONTROLADOR, Conex.URL_BASEDATOS, Conex.NOMBRE_USUARIO, Conex.CONTRA, prod_pend);
                this.jTable1.setModel(prods);
            } catch (SQLException ex) {
                Logger.getLogger(Productos.class.getName()).log(Level.SEVERE, null, ex);
            } catch (ClassNotFoundException ex) {
                Logger.getLogger(Productos.class.getName()).log(Level.SEVERE, null, ex);
            }

    }//GEN-LAST:event_jTable1_pendMouseClicked

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                Recetas dialog = new Recetas(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Buscar_Receta;
    private javax.swing.JButton buscar_pendiente;
    private javax.swing.JTextField digito_pend;
    private javax.swing.JTextField digito_vend;
    private javax.swing.JTabbedPane grupo_pest;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel1_pend;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel2_vend;
    private javax.swing.JPanel jPanel2_vend;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane1_pend;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane2_vend;
    private javax.swing.JTable jTable1;
    private javax.swing.JTable jTable1_pend;
    private javax.swing.JTable jTable2;
    private javax.swing.JTable jTable2_Vend;
    private javax.swing.JTextField jTextField1_pend;
    private javax.swing.JTextField jTextField2_vend;
    private javax.swing.JPanel panel_pend;
    private javax.swing.JPanel panel_recetas;
    private javax.swing.JScrollPane pendientes;
    private javax.swing.JLabel titulo_recetas;
    private javax.swing.JScrollPane vendidas;
    // End of variables declaration//GEN-END:variables

}
